<?php use_stylesheet('orders.css') ?>
 
<?php slot('title', sprintf('Orders in the %s category', $category->getCategoryname())) ?>
 
<div class="category">
  <div class="feed">
    <a href="">Feed</a>
  </div>
  <h1><?php echo $category ?></h1>
</div>
 
<?php include_partial('order/list', array ('orders' => $pager->getResults())) ?>

<?php if ($pager->haveToPaginate()): ?>
  <div class ="pagination">
    <a href="<?php echo url_for('category', $category)?>?page=1">
      <img src="/images/first.png" alt="First page" title="First page" />
    </a>

    <a href="<?php echo url_for('category', $category)?>?page=<?php echo $pager->getPreviousPage() ?>">
      <img src="/images/previous.png" alt="Previous page" title="Previous page" />
    </a>

    
      <?php //only a link to the pages that are not the current one
      foreach ($pager->getLinks() as $page): ?>
        <?php if ($page == $pager->getPage()): ?>
          <?php echo $page ?>
        <?php else: ?>
          <a href="<?php echo url_for('category', $category) ?>?page=<?php echo $page ?>"><?php echo $page ?></a>
        <?php endif; ?>
      <?php endforeach; ?>
    
    
    <a href="<?php echo url_for('category', $category)?>?page=<?php echo $pager->getNextPage() ?>">
      <img src="/images/next.png" alt="next page" title="Next page" />
    </a>
    
    <a href="<?php echo url_for('category', $category)?>?page=<?php echo $pager->getLastPage() ?>">
      <img src="/images/last.png" alt="Last page" title="Last page" />
    </a>
    
  </div>

<?php endif; ?>

<div class="pagination_desc">
  <strong><?php echo $pager->getNbResults() ?></strong> orders in this category
 
  <?php if ($pager->haveToPaginate()): ?>
    - page <strong><?php echo $pager->getPage() ?>/<?php echo $pager->getLastPage() ?></strong>
  <?php endif; ?>
</div>